<?php
class Pessoa extends AppModel {

	var $name = 'Pessoa';
	var $displayField = 'nome';
	var $actsAs = array('CakePtbr.Validacao');
	var $validate = array(
		'nome' => array('notempty'),
		'nascimento' => array('date'),
		'sexo' => array('alphanumeric'),
		'cpf' => array(
			'rulecpf' => array(
				'rule' => array('cpf', true),
				'message' => 'CPF incorreto'),
			'ruleisUnique' => array(
				'rule' => 'isUnique',
				'message' => 'CPF ja cadastrado'
			)
		));


	//The Associations below have been created with all possible keys, those that are not needed can be removed
	var $hasOne = array(
		'Funcionario' => array(
			'className' => 'Funcionario',
			'foreignKey' => 'pessoa_id',
			'dependent' => false,
			'conditions' => '',
			'fields' => '',
			'order' => ''
		)
	);
	var $hasMany = array(
	'Medico' => array(
		'className' => 'Medico',
		'foreignKey' => 'pessoa_id',
		'dependent' => false,
		'conditions' => '',
		'fields' => '',
		'order' => ''
	)
);

}
?>